package com.springboot.ykz.dependinject;

import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

@Component
//@Primary //如果有两个primary则会报错：，Animal' available: more than one 'primary' bean found among candidates: [cat, dog]
public class Cat implements Animal {
    @Override
    public void use() {
        System.out.println(" Cat catch the mouse：【"+getClass().getName()+ "】");
    }
}
